#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:p="http://primefaces.org/ui" template="/templates/loggedTemplate.xhtml">
	 
	<f:metadata>
		<f:event type="preRenderView"
			listener="${symbol_pound}{usuarioBean.loadDataModel}" />
	</f:metadata>
	
	<ui:define name="content">
		
		<h1 class="formTitle ui-widget-header ui-corner-all">${symbol_pound}{msg['usuario.titulo.lista']}</h1>
		<h:form id="usuarioForm">
			<p:panel id="panel">

				<p:messages />

				<div id="buttons" class="ui-widget">
					<p:commandButton value="${symbol_pound}{msg['botao.criar']}" action="${symbol_pound}{usuarioBean.criar}" />
				</div>
				
				<p:dataTable var="usuario" value="${symbol_pound}{usuarioBean.dataModel}"
					paginator="true" rows="${symbol_pound}{usuarioBean.pageSize}" emptyMessage="${symbol_pound}{msg['dataModel.lista.vazia']}"
					paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
					rowsPerPageTemplate="5,10,15" selectionMode="single" rowKey="${symbol_pound}{usuario.id}"
					selection="${symbol_pound}{usuarioBean.entidade}" id="dataModel" lazy="true">
	
					<p:column headerText="${symbol_pound}{msg['usuario.nome']}" sortBy="${symbol_pound}{usuario.nome}"
						filterBy="${symbol_pound}{usuario.nome}">
						<h:outputText value="${symbol_pound}{usuario.nome}" />
					</p:column>
	
					<p:column headerText="${symbol_pound}{msg['usuario.login']}" sortBy="${symbol_pound}{usuario.login}"
						filterBy="${symbol_pound}{usuario.login}">
						<h:outputText value="${symbol_pound}{usuario.login}" />
					</p:column>
					
					<p:column headerText="${symbol_pound}{msg['dataModel.coluna.acoes']}">
						<p:commandButton value="${symbol_pound}{msg['botao.editar']}" action="${symbol_pound}{usuarioBean.editar}" />
						<p:commandButton value="${symbol_pound}{msg['botao.remover']}" action="${symbol_pound}{usuarioBean.remover}" />
					</p:column>
	
				</p:dataTable>
			</p:panel>
		</h:form>
	</ui:define>
</ui:composition>
